<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JavaScript基础语法</title>

</head>

<body>
    <script>
        var x;
        let y = 0;
        const PI = 3.14
        console.log(x, y, PI);
        let name = "如花";
        console.log(name);
        let empty_value = null;
        console.log(empty_value);

        let age = 9;
        if (age > 18) {
            console.log("你已经成年了！！");
        }else {
            console.log("未成年警告！！");
        }

        let time = 12;
        if (time < 12) {
            alert("上午好~")
        }else if(time = 12) {
            alert("中午好~")
        }else {
            alert("下午好~")
        }

        console.log("for循环");
        for (let i = 1; i < 7; i++) {
            console.log(i);
        }

        console.log("while循环");
        let count = 1;
        while (count <= 10) {
            console.log(count);
            count++;
        }

        console.log("循环关键字");
        for (var i = 0; i < 7; i++) {
            if (i == 2) {
                continue; // 跳过当前这段代码（i = 2）
            }
            if (i == 4) {
                break; // 结束循环
            }
            console.log(i);
        }
    </script>
</body>
</html>